<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page import="com.park.layout.Blocks" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%-- JSTL表达式（判断，循环，输出） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%-- 方法表达式（字符串截取，替换） --%>
<%@ taglib uri="http://www.wanwei.com/tags/tag" prefix="layout" %>

<layout:override name="<%=Blocks.BLOCK_HEADER_CSS%>">
    <link href="Content/style/common/style.min.css?v=${static_resource_version}" rel="stylesheet" type="text/css">
    <style>
        .banner{    border: 1px solid #E5E5E5; padding: 20px;}
    </style>
</layout:override>

<layout:override name="<%=Blocks.BLOCK_HEADER_SCRIPTS%>">
    <script src="Content/dist/jquery-form.js?v=${static_resource_version}"></script>
    <script>

        function saveConfig(){
            $("#configForm").ajaxSubmit({
                type: "post",
                dataType: "json",
                data: $(this).serialize(),
                url: "passport/saveConfig",
                success: function (res) {
                    alert(res.message);
                    if(res.code == 1) {
                        window.location.reload();
                    }
                },
                error: function (msg) {}
            });
        }
    </script>
</layout:override>

<layout:override name="<%=Blocks.BLOCK_BODY%>">
    <div class="container-fluid" style="text-align: left">
        <div id="center_form" class="form-horizontal" novalidate>
            <div class="panel panel-default">
                <div class="panel-heading">奖金设置</div>
                <div class="panel-body">
                    <div class="col-sm-offset-2 col-sm-8" style="padding-bottom: 200px;">
                        <div id="banners">

                            <div class="banner">
                            <form id="configForm">

                                <div class="form-group">
                                    <label class="col-sm-4 control-label">
                                        一级奖金
                                    </label>
                                    <div class="col-sm-8">
                                        <input type="text" name="firstLevel" class="form-control bannerUrl" placeholder="一级奖金，如输入0.2，则奖金为总价的20%" value="${config.firstLevel}" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">
                                        二级奖金
                                    </label>
                                    <div class="col-sm-8">
                                        <input type="text" name="secondLevel" class="form-control bannerUrl" placeholder="二级奖金，如输入0.2，则奖金为总价的20%" value="${config.secondLevel}" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">
                                        三级奖金
                                    </label>
                                    <div class="col-sm-8">
                                        <input type="text" name="thirdLevel" class="form-control bannerUrl" placeholder="三级奖金，如输入0.2，则奖金为总价的20%" value="${config.thirdLevel}" />
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="text-center" style="padding-top: 20px;">
                                        <button type="button" class="btn btn-success password-confirm" onclick="saveConfig()">
                                            <span class="glyphicon glyphicon-ok"></span> 保 存
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</layout:override>

<c:import url="../Shared/Layout.jsp">
    <c:param name="title" value=""/>
</c:import>
